package com.jtjrenren.android.taxi.passenger.core.user.register;

import com.jtjrenren.android.taxi.passenger.Constants;
import com.jtjrenren.android.taxi.passenger.manger.api.ApiWorks;
import com.jtjrenren.android.taxi.passenger.utils.ModuleUtils;

/**
 * Created by Administrator on 2016/9/13.
 */

public class RegisterInteractorImpl implements RegisterInteractor {
    @Override
    public void checkPhoneUni(String phone, ApiWorks.ResponseListener listener) {
        ApiWorks.checkPhoneUnie(phone, listener);
    }

    @Override
    public void sendCode(String phone, ApiWorks.ResponseListener listener) {
        ApiWorks.sendAuthCode(phone, Constants.DEFAULT_SMSTYPE_REGISTER, listener);
    }

    @Override
    public void checkCode(String phone, String code, ApiWorks.ResponseListener listener) {
        ApiWorks.authPhoneByCode(code, phone, Constants.DEFAULT_SMSTYPE_REGISTER,listener);
    }

    @Override
    public void register(String phone, String pwd, ApiWorks.ResponseListener listener) {
        ApiWorks.registerByPhone(phone, ModuleUtils.DesEncry(pwd), listener);
    }
}
